<template>
    <div class="goodDetail">
        <div class="top">
            <van-swipe :autoplay="3000">
                <van-swipe-item v-for="item in detail.pics" :key="item.id">
                    <img :src="item.pic" />
                </van-swipe-item>
            </van-swipe>
            <div class="top-detail">
                <h3>{{baseInfo.name}}</h3>
                <span class="desc">{{baseInfo.characteristic}}</span>
                <section>
                    <span class="minPrice">底价<em>￥{{baseInfo.minPrice}}</em><i>原价￥{{baseInfo.originalPrice}}</i></span>
                    <span>库存{{baseInfo.stores}}</span>
                </section>
            </div>
        </div>
        
    </div>
</template>

<script>
import { goodDetail } from '@/api/home'
export default {
    name: '',
    data() { 
        return {
            detail: {},
            baseInfo: {}
        }
    },
    created() {
        goodDetail(this.$route.params.id).then(res => {
            this.detail = res.data
            this.baseInfo = res.data.basicInfo
        }) 
    }
}
</script>

<style scoped lang="scss">
img {
    width: 100%;
    height: 750px;
}
.top-detail {
    padding-top: 40px;
    padding-left: 30px;
    padding-bottom: 20px;
    background-color: #fff;
    h3 {
        font-size: 36px;
        color: #333;
    }
    .desc {
        font-size: 24px;
        color: #b2b2b2;
    }
    section {
        display: flex;
        width: 100%;
        justify-content: space-between;
        font-size: 24px;
        margin-top: 40px;
        padding-right: 20px;
        color: #b2b2b2;
        .minPrice {
            color: #CC0C0C;
            em {
                font-size: 30px;
                margin-right: 40px;
            }
            i {
            color: #b2b2b2;}
        }
    }
}
</style>